<?php


namespace App\Models;


class GuidePage extends Model
{
    protected $table = 'guide_pages';


    const BOOK_PAGE = 1;

    // ============= scope ==========
    public function scopeOfType($query, $type)
    {
        return $query->where('type', $type);
    }

    // ============= field ==========
    public function setType($type)
    {
        $this->type = $type;
    }

    public function getType()
    {
        return $this->type;
    }

    public function setGuideId($guideId)
    {
        $this->guide_id = $guideId;
    }

    public function setContent($content)
    {
        $this->content = json_encode($content);
    }

    public function getContent()
    {
        return json_decode($this->content, true);
    }

    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {
        $this->name = $name;
    }

    public function setSequence($sequence)
    {
        $this->sequence = $sequence;
    }

}